package com.bw.mvvm_common.mvvm.network;



import com.bw.mvvm_common.mvvm.network.inteceptor.SignInterceptor;
import com.bw.mvvm_common.mvvm.network.inteceptor.Tokeninterceptor;

import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

public
/**
 * @author Guan
 * @description:
 * @date :2021/9/8 0008 下午 4:39
 *
 */
   class TokenSignimpl  extends Baseimpl{

    Retrofit retrofit;
    @Override
    public Retrofit getRetrofit() {

        OkHttpClient.Builder builder = creatOkhttpBuilder();
        builder.addInterceptor(new Tokeninterceptor());
        builder.addInterceptor(new SignInterceptor());

        Retrofit.Builder retrofitb = new Retrofit.Builder();
        retrofitb.baseUrl(Api.basURl);
        retrofitb.client(builder.build());
        retrofitb.addConverterFactory(GsonConverterFactory.create());
        retrofitb.addCallAdapterFactory(RxJava2CallAdapterFactory.create());
        retrofit = retrofitb.build();
        return retrofit;
    }
}
